<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>26 ngTouch</title>
    <script src="../../lib/angularjs/angular.js"></script>
    <script src="../../lib/angularjs/angular-touch.min.js"></script>
</head>
<body ng-app="touchApp">
<div ng-touchmove="someFunction($event)" ng-touchstart="someFunction($event)" ng-touchend="someFunction($event)">
	<ul ng-controller="touchCtrl">
		<li ng-repeat="mail in emails">
			<div ng-show="!mail.showActions" ng-swipe-left="mail.showActions=true">
				<div class="from">
					From: <span>{{ mail.from }}</span>
				</div>
				<div class="body">
					{{ mail.body }}
				</div>
			</div>
			<div ng-show="mail.showActions" ng-swipe-right="mail.showActions=false">
				<ul class="actions">
					<li><button>Archive</button></li>
					<li><button>Trash</button></li>
				</ul>
			</div>
		</li>
	</ul>
</div>
</body>
<script>
    var app=angular.module("touchApp",["ngTouch"]);
    app.controller("touchCtrl",["$scope",function ($scope) {
        $scope.emails=[{from:"张三",body:"中国，你好！"},{from:"张三",body:"中国，你好！"},{from:"张三",body:"中国，你好！"}];
		$scope.someFunction=function($event){
			alert($event);
		}
    }]);
</script>
</html>